import { invoke } from '@tauri-apps/api';

// 添加前端监控
export const initMonitoring = () => {
  window.addEventListener('error', (e) => {
    invoke('log_error', {
      message: e.message,
      stack: e.error?.stack,
      component: 'MediaPlayer'
    });
  });
};

export function logError(error: Error) {
  invoke('log_error', {
    message: error.message,
    stack: error.stack || ''
  });
} 